<template>
  <div>
    <el-breadcrumb separator-class="el-icon-arrow-right" class="nav">
      <el-breadcrumb-item to="/welcome"
        ><strong>首页</strong></el-breadcrumb-item
      >
      <el-breadcrumb-item>权限管理</el-breadcrumb-item>
      <el-breadcrumb-item>权限列表 </el-breadcrumb-item>
    </el-breadcrumb>
    <el-card class="box-card">
      <!--表格-->
      <el-table class="table" border :data="list" style="width: 100%">
        <el-table-column align="center" label="" width="50">
          <template slot-scope="{ $index }">
            {{ $index + 1 }}
          </template>
        </el-table-column>
        <el-table-column prop="authName" label="权限名称"> </el-table-column>
        <el-table-column prop="path" label="路径"> </el-table-column>
        <el-table-column label="权限等级">
          <template slot-scope="{ row }">
            <span
              :class="[
                row.level == '0'
                  ? 'el-tag el-tag--light'
                  : row.level == '1'
                  ? 'el-tag el-tag--success el-tag--light'
                  : 'el-tag el-tag--warning el-tag--light',
              ]"
              v-html="
                row.level == '0' ? '一级' : row.level == '1' ? '二级' : '三级'
              "
            ></span>
          </template>
        </el-table-column> </el-table
    ></el-card>
  </div>
</template>
<script>
import { rightsApi } from '@/api/rights'
export default {
  name: 'Titlelist',
  data () {
    return {
      list: []
    }
  },
  created () {
    this.getrightsApi()
  },
  computed: {
  },
  methods: {
    async getrightsApi () {
      const res = await rightsApi()
      this.list = res.data
      // console.log(res, 888);
    }
  }
}
</script>
<style lang='less'  scoped>
.nav {
  font-size: 12px;
  margin-bottom: 15px;
}
.table {
  font-size: 12px;
}
</style>
